// page/member/wallet.js
Page({

  /**
   * 页面的初始数据
   */
  data: {
  
  },

  onShow: function () {
    var app = getApp()
    var that = this;
    var uid = wx.getStorageSync('uid');
    // console.log(uid)
    wx.request({
      url: app.globalData.host + '&g=App&m=User&a=my_wallet',
      data: { uid: uid },
      header: {
        'content-type': 'application/json'
      },
      success: function (res) {
        console.log(res.data)
        var money = res.data.money;
        that.setData({
          money:res.data.money
        })
      }
    })
  },
  nav:function(e){
    var money = this.data.money;
    if (money > 0) {
      wx.navigateTo({
        url: '/page/member/withdraw'
      })
    } else {
      wx.showModal({
        title: '提示',
        content: '无可提现金额',
        showCancel: false,
        duration: 2000,
      })
    }
  }
})